#include <cstdio>
#include <cstring>

int map[1010][1010] = {0};
int visit[1010] = {0};
int hasPath = 0;

void getPath(int start, int end, int n)
{
	visit[start] = 1;
	if ( start == end ) {
		hasPath = 1;
		return;
	}
	
	for ( int i = 1; i <= n; i++ ) {
		if ( visit[i] == 1 ) {
			continue;
		}
		if ( map[start][i] == 1 ) {
			getPath(i, end, n);
		}
	}
}

int main()
{
	int n = 0, m = 0, t = 0;
	scanf("%d %d %d", &n, &m, &t);
	int a = 0, b = 0;
	for ( int i = 0; i < m; i++) {
		scanf("%d %d", &a, &b);
		map[a][b] = 1;
		map[b][a] = 1;
	}
	
	int x = 0, y = 0;
	for (int i = 0; i < t; i++ ) {
		scanf("%d %d", &x, &y);
		memset(&visit[0], 0, sizeof(visit));
		hasPath = 0;
		getPath(x, y, n);
		if ( hasPath ) {
			printf("Yes\n");
		}
		else {
			printf("No\n");
		}
	} 
	return 0;
} 
